home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / StandardFile.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  7.5 KB  |  251 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        StandardFile.a
  3. ;
  4. ;    Contains:    Standard File package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1990-1995, 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  18. __STANDARDFILE__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  24.     include 'Dialogs.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.  
  30.  
  31.                                                             ; resource IDs of pre-7.0 get and put dialogs 
  32. putDlgID                        EQU        -3999
  33. getDlgID                        EQU        -4000
  34.  
  35.                                                             ; item offsets of pre-7.0 get and put dialogs 
  36. putSave                            EQU        1
  37. putCancel                        EQU        2
  38. putEject                        EQU        5
  39. putDrive                        EQU        6
  40. putName                            EQU        7
  41. getOpen                            EQU        1
  42. getCancel                        EQU        3
  43. getEject                        EQU        5
  44. getDrive                        EQU        6
  45. getNmList                        EQU        7
  46. getScroll                        EQU        8
  47.  
  48.                                                             ; resource IDs of 7.0 get and put dialogs 
  49. sfPutDialogID                    EQU        -6043
  50. sfGetDialogID                    EQU        -6042
  51.  
  52.                                                             ; item offsets of 7.0 get and put dialogs 
  53. sfItemOpenButton                EQU        1
  54. sfItemCancelButton                EQU        2
  55. sfItemBalloonHelp                EQU        3
  56. sfItemVolumeUser                EQU        4
  57. sfItemEjectButton                EQU        5
  58. sfItemDesktopButton                EQU        6
  59. sfItemFileListUser                EQU        7
  60. sfItemPopUpMenuUser                EQU        8
  61. sfItemDividerLinePict            EQU        9
  62. sfItemFileNameTextEdit            EQU        10
  63. sfItemPromptStaticText            EQU        11
  64. sfItemNewFolderUser                EQU        12
  65.  
  66.                                                             ; pseudo-item hits for use in DlgHook 
  67. sfHookFirstCall                    EQU        -1
  68. sfHookCharOffset                EQU        $1000
  69. sfHookNullEvent                    EQU        100
  70. sfHookRebuildList                EQU        101
  71. sfHookFolderPopUp                EQU        102
  72. sfHookOpenFolder                EQU        103                    ; the following are only in system 7.0+ 
  73. sfHookLastCall                    EQU        -2
  74. sfHookOpenAlias                    EQU        104
  75. sfHookGoToDesktop                EQU        105
  76. sfHookGoToAliasTarget            EQU        106
  77. sfHookGoToParent                EQU        107
  78. sfHookGoToNextDrive                EQU        108
  79. sfHookGoToPrevDrive                EQU        109
  80. sfHookChangeSelection            EQU        110
  81. sfHookSetActiveOffset            EQU        200
  82.  
  83. ;  the refcon field of the dialog record during a
  84. ; modalfilter or dialoghook contains one of the following 
  85.  
  86. sfMainDialogRefCon                EQU        'stdf'
  87. sfNewFolderDialogRefCon            EQU        'nfdr'
  88. sfReplaceDialogRefCon            EQU        'rplc'
  89. sfStatWarnDialogRefCon            EQU        'stat'
  90. sfLockWarnDialogRefCon            EQU        'lock'
  91. sfErrorDialogRefCon                EQU        'err '
  92.  
  93. SFReply                    RECORD 0
  94. good                     ds.b    1                ; offset: $0 (0)
  95. copy                     ds.b    1                ; offset: $1 (1)
  96. fType                     ds.l    1                ; offset: $2 (2)
  97. vRefNum                     ds.w    1                ; offset: $6 (6)
  98. version                     ds.w    1                ; offset: $8 (8)
  99. fName                     ds        StrFileName        ; offset: $A (10)        ;  a Str63 on MacOS 
  100. sizeof                     EQU *                    ; size:   $4A (74)
  101.                         ENDR
  102. StandardFileReply        RECORD 0
  103. sfGood                     ds.b    1                ; offset: $0 (0)
  104. sfReplacing                 ds.b    1                ; offset: $1 (1)
  105. sfType                     ds.l    1                ; offset: $2 (2)
  106. sfFile                     ds        FSSpec            ; offset: $6 (6)
  107. sfScript                 ds.w    1                ; offset: $4C (76)
  108. sfFlags                     ds.w    1                ; offset: $4E (78)
  109. sfIsFolder                 ds.b    1                ; offset: $50 (80)
  110. sfIsVolume                 ds.b    1                ; offset: $51 (81)
  111. sfReserved1                 ds.l    1                ; offset: $52 (82)
  112. sfReserved2                 ds.w    1                ; offset: $56 (86)
  113. sizeof                     EQU *                    ; size:   $58 (88)
  114.                         ENDR
  115. ;  for CustomXXXFile, ActivationOrderListPtr parameter is a pointer to an array of item numbers 
  116. ; typedef const short *                    ActivationOrderListPtr
  117.  
  118. ;  the following also include an extra parameter of "your data pointer" 
  119. SFTypeList                RECORD 0
  120. elements                 ds.l    4
  121. sizeof                     EQU *                    ; size:   $10 (16)
  122.                         ENDR
  123.  
  124.  
  125. ;    The GetFile "typeList" parameter type has changed from "SFTypeList" to "ConstSFTypeListPtr".
  126. ;    For C, this will add "const" and make it an in-only parameter.
  127. ;    For Pascal, this will require client code to use the @ operator, but make it easier to specify long lists.
  128. ;
  129. ;    ConstSFTypeListPtr is a pointer to an array of OSTypes.
  130. ;
  131.  
  132. ; typedef const OSType *                ConstSFTypeListPtr
  133.  
  134. ;
  135. ; pascal void SFPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _SFPutFile
  140.             move.w              #$0001,-(sp)
  141.             dc.w                $A9EA
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION SFPutFile
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal void SFGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  151.         Macro
  152.         _SFGetFile
  153.             move.w              #$0002,-(sp)
  154.             dc.w                $A9EA
  155.         EndM
  156.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  157.         IMPORT_CFM_FUNCTION SFGetFile
  158.     ENDIF
  159.  
  160. ;
  161. ; pascal void SFPPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  162. ;
  163.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  164.         Macro
  165.         _SFPPutFile
  166.             move.w              #$0003,-(sp)
  167.             dc.w                $A9EA
  168.         EndM
  169.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  170.         IMPORT_CFM_FUNCTION SFPPutFile
  171.     ENDIF
  172.  
  173. ;
  174. ; pascal void SFPGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  175. ;
  176.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  177.         Macro
  178.         _SFPGetFile
  179.             move.w              #$0004,-(sp)
  180.             dc.w                $A9EA
  181.         EndM
  182.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  183.         IMPORT_CFM_FUNCTION SFPGetFile
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal void StandardPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply)
  188. ;
  189.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  190.         Macro
  191.         _StandardPutFile
  192.             move.w              #$0005,-(sp)
  193.             dc.w                $A9EA
  194.         EndM
  195.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  196.         IMPORT_CFM_FUNCTION StandardPutFile
  197.     ENDIF
  198.  
  199. ;
  200. ; pascal void StandardGetFile(FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply)
  201. ;
  202.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  203.         Macro
  204.         _StandardGetFile
  205.             move.w              #$0006,-(sp)
  206.             dc.w                $A9EA
  207.         EndM
  208.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  209.         IMPORT_CFM_FUNCTION StandardGetFile
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal void CustomPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  214. ;
  215.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  216.         Macro
  217.         _CustomPutFile
  218.             move.w              #$0007,-(sp)
  219.             dc.w                $A9EA
  220.         EndM
  221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION CustomPutFile
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal void CustomGetFile(FileFilterYDUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  229.         Macro
  230.         _CustomGetFile
  231.             move.w              #$0008,-(sp)
  232.             dc.w                $A9EA
  233.         EndM
  234.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  235.         IMPORT_CFM_FUNCTION CustomGetFile
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal OSErr StandardOpenDialog(StandardFileReply *reply)
  240. ;
  241.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION StandardOpenDialog
  243.     ENDIF
  244.  
  245.  
  246.  
  247.  
  248.     ENDIF ; __STANDARDFILE__ 
  249.  
  250.